package com.css.dzj.zfjg.modules.admpenalty;

import cn.afterturn.easypoi.excel.entity.result.ExcelVerifyHandlerResult;
import cn.afterturn.easypoi.handler.inter.IExcelVerifyHandler;
import com.css.dzj.zfjg.modules.admpenalty.Vo.AdmExcelVo;
import org.springframework.stereotype.Component;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 自定义校验接口
 * @Author WT
 * @Date 2020/6/4
 */
@Component
public class AdmExcelVerifyHandler implements IExcelVerifyHandler<AdmExcelVo> {

    @Override
    public ExcelVerifyHandlerResult verifyHandler(AdmExcelVo admExcelVo) {
        ExcelVerifyHandlerResult result = new ExcelVerifyHandlerResult(true);
        StringBuilder message = new StringBuilder("");
        try {
             if("否".equals(admExcelVo.getIsSubmit()) || "02".equals(admExcelVo.getIsSubmit())){
                 result.setSuccess(false);
                 message.append("此案件信息未经过本单位领导审核");
             }

        }catch (Exception e){
            e.printStackTrace();
        }
         result.setMsg(message.toString());
        return result;
    }

    public AdmExcelVerifyHandler() {
    }
}
